﻿@using Carer.Data.Enum
@using Carer.App
@model Carer.Crm.ViewModel.IndexModel

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewBag.Title</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/Bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/Bootstrap-table/bootstrap-table.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/jQuery/jquery-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/jQuery/jquery-ui-timepicker-addon.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/Common/basic.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/Common/custom.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/Layout/layoutNew.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default navbar-cls-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <a class="navbar-brand" href="/">康护之星</a>
            </div>
            <div class="header-right dropdown">
                <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
                    @Model.UserName
                    <span class="fa fa-caret-down"></span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                    <li role="presentation">
                        <a role="menuitem" tabindex="-1" href="/Home/Logout">退出</a>
                    </li>
                </ul>
            </div>
            <div class="header-right dropdown">
                @Html.Partial("_IndexUnitPartial", Model)
            </div>
        </nav>
        <!-- /. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                    <li>
                        <a class="active-menu" href="javascript:void(0)"><i class="fa fa-dashboard "></i>功能菜单</a>
                    </li>
                    @foreach (var itemOne in Model.Menu.Where(it => it.Level == 1))
                    {
                        <li>
                            <a href="#"><i class="@itemOne.CssClass"></i>@itemOne.Name<span class="fa arrow"></span></a>
                            @if (Model.Menu.Any(it => it.Fid == itemOne.Id))
                            {
                                <ul id="sub1" class="nav sub">
                                    @foreach (var itemTwo in Model.Menu.Where(it => it.Fid == itemOne.Id))
                                    {
                                        <li>
                                            <a href="#@itemTwo.Url"><i class="@itemTwo.CssClass"></i>@itemTwo.Name</a>
                                        </li>
                                    }
                                </ul>
                            }
                        </li>
                    }
                </ul>

            </div>

        </nav>
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper">
            @RenderBody()
        </div>
        <!-- /. PAGE WRAPPER  -->
    </div>
    <!-- /. WRAPPER  -->

    <div id="footer-sec" style="display:none">
        footer内容
    </div>
    <script src="~/Content/jQuery/jquery-1.10.1.min.js" type="text/javascript"></script>
    <script src="~/Content/Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="~/Content/Bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
    <script src="~/Content/Bootstrap-table/bootstrap-table-zh-CN.min.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery.metisMenu.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery.hoverIntent.minified.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery-ui-timepicker-addon.min.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery-ui-timepicker-zh-CN.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery.paginate.js" type="text/javascript"></script>
    <script src="~/Content/jQuery/jquery.form.js" type="text/javascript"></script>
    <script src="~/Content/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>
    <script src="~/Content/jquery-validation/additional-methods.js?v=@MvcApplication.TimeStamp" type="text/javascript"></script>
    <script src="~/Content/jquery-validation/messages_zh.min.js" type="text/javascript"></script>
    <script src="~/Content/Common/custom.js" type="text/javascript"></script>
    <script src="~/Content/Common/pagify.js" type="text/javascript"></script>
    <script src="~/Content/Common/util.js" type="text/javascript"></script>
    <script type="text/javascript">
        $('#page-wrapper').pagify({
            pages: [],
            animation: 'fadeIn',
            'default': "Index",
            cache: false,
            basePagePath: window._util.BASE_URL + "/Html"
        });

        $(function () {
            window.UserUnit = {
                Id: $(".cls-unit-id").attr("data"),
                Role: '@((int)Model.Role)'
            };
            $.ajax({
                url: window._util.BASE_URL + "/Home/GetConfig",
                method: "GET",
                contentType: "application/json;charset=UTF-8",
                cache: false,
                async: true,
                dataType: "json",
                success: function (resp) {
                    if (resp != null && resp.Success) {
                        window._util.ItemCode.ServiceType = resp.Data.ServiceType;
                        window._util.ItemCode.CrewType = resp.Data.CrewType;
                        window._util.ItemCode.Payment = resp.Data.Payment;
                        window._util.ItemCode.UserUint = resp.Data.UserUint;
                        window._util.ItemCode.AllUnit = resp.Data.AllUnit;
                    } else {
                        console.error(resp);
                    }
                }
            }).fail(function (G, F) {
                alert("浏览器超时未响应，请刷新重试");
            });
        });
    </script>
    @RenderSection("scripts", required: false)
</body>
</html>
